/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.acworks.acroute;

import java.util.List;

/**
 * Route = ordered collection of adjacent OWNED SPACES spaces, starting with INTAKE_VALVE_SPACE,
 * going through OWNED_ROOMS only and possibly terminating at AC_ROOM
 * terminating with AC_ROOM, and containing all of DS's OWNED_ROOMS exactly once each.
 * 
 * @author nikita
 */
public interface Route {

    /**
     *
     * @return list of owned rooms that are adjacent to the current space and hadn't already been visited on this route
     */
    List<Space> getAdjacentUnvisitedOwnedRooms();

    Space getCurrentSpace();

    /**
     *
     * @return list of spaces that make up this route
     */
    List<Space> getRouteSpaces();

    /**
     * add space to this route only if legal, else throw exception
     * @param space
     */
    void advanceToSpace(Space space);

    /**
     *
     * @param space
     * @return true only if it's legal to add given space to this route
     */
    boolean canAdvanceToSpace(Space space);

    /**
     * @return true only if no more spaces can be added to this route
     */
    boolean isTerminated();

    /**     
     * @return true only if this route successfully:
     * -traverses all OWNED_ROOMS (and only owned rooms)
     * -terminates at AC_ROOM
     */
    boolean isValid();

    Datacenter getDatacenter();
}
